package com.tarena.lbs.business.dao.repository.impl;

import com.tarena.lbs.business.dao.mapper.BusinessCategoryMapper;
import com.tarena.lbs.business.dao.repository.BusinessCategoryRepository;
import com.tarena.lbs.business.pojo.po.BusinessCategoryPO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class BusinessCategoryRepositoryImpl implements BusinessCategoryRepository {

    private BusinessCategoryMapper businessCategoryMapper;
    @Autowired
    public void setBusinessCategoryMapper(BusinessCategoryMapper businessCategoryMapper) {
        this.businessCategoryMapper = businessCategoryMapper;
    }

    public List<BusinessCategoryPO> allCategories() {
        return businessCategoryMapper.selectList(null);
    }

    public BusinessCategoryPO selectPO(Integer id) {
        return businessCategoryMapper.selectById(id);
    }
}
